
cluster=$1
cor_gene_peak=$2
celltype_name=$3
cpu=$4
config_path=$5

source ${config_path}/config.sh

data_base_list=(jaspar cisbp)

for data_base in ${data_base_list[@]}
do
${Rscript_chromvar} ${scripts_dir}/tf_gene.R \
--peak_gene_file ${output_dir}/cluster_all_result/${cluster}/correlation/${cluster}_correlation_magic.Rdata \
--rnaData_file ${input_dir}/testis_combined.Rdata \
--atacData_file ${output_dir}/motif/${cluster}/${data_base}/${cluster}.chromvar.rda \
--cluster ${cluster} \
--data_base ${data_base} \
--cor_gene_peak ${cor_gene_peak} \
--cell_name ${celltype_name} \
--cpu ${cpu} \
--out_path ${output_dir}/motif/${cluster}/${data_base} \
2> ${log_path}/tf_score.${cluster}.${data_base}.log
done